package br.com.djiadreams.georeferencedsignalproject;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import br.com.djiadreams.extras.FabricaDeCores;

import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter;
import com.google.android.gms.maps.model.Marker;

public class AdaptadorInfoWindow implements InfoWindowAdapter {

	private final View contentView;

	public AdaptadorInfoWindow(Context c) {
		LayoutInflater inflater = (LayoutInflater) c
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		contentView = inflater.inflate(R.layout.marcadorcustomizado, null);
	}

	@Override
	public View getInfoContents(Marker marker) {
		TextView operadora = ((TextView) contentView
				.findViewById(R.id.operadora));
		operadora.setText(marker.getTitle());
		TextView qualidade = ((TextView) contentView
				.findViewById(R.id.qualidadeSinal));
		qualidade.setText(marker.getSnippet());
		qualidade.setTextColor(FabricaDeCores.geraCor(marker.getSnippet()));
		return contentView;
	}

	@Override
	public View getInfoWindow(Marker arg0) {
		// TODO Auto-generated method stub
		return null;
	}

}
